/*
 ============================================================================
 Page	     : 197
 Name        : paint.c
 Date	     : 20210403
 Author      : Hbue 18060333
 Copyright   : Your copyright notice
 Description : 使用条件运算符
 ============================================================================
 */

#include <stdio.h>
#define COVERAGE 350		// 每罐油漆可刷的面积(单位:平方英尺)
int main(void)
{
	int sq_feet = 0;
	int cans = 0;

	printf("Enter number of square feet to be painted:\n");
	while(scanf("%d", &sq_feet) == 1)
	{
		cans = sq_feet / COVERAGE;
		cans += ((sq_feet % COVERAGE == 0)) ? 0 : 1;
		printf("You need %d %s of paint.\n", cans, cans == 1 ? "can" : "cans");
		printf("Enter next value (q to quit):\n");
	}

	return 0;
}

